import api from './index'
import request from "../utils/request";

//admin找回密码
export function findPwdSmsAdmin(phone){
  const data = {
    phone:phone
  }
  return request({
    url:api.findPwdSmsAdmin,
    method:'post',
    data
  })
}

export function resetPwdAdmin(username,newpassword){
  const data = {
   username:username,
    newpassword:newpassword
  }
  return request({
    url:api.resetPwdAdmin,
    method:'post',
    data
  })
}

//用户
//用户找回密码时发送短信
export function findPwdSmsUser(phone){
  const data = {
    phone:phone
  }
  return request({
    url:api.findPwdSmsUser,
    method:'post',
    data
  })
}
//重置密码
export function resetPwdUser(uname,newpass){
  const data = {
    username:uname,
    newpassword:newpass
  }
  return request({
    url:api.resetPwdUser,
    method:'post',
    data
  })
}

export function checkSecUser(uname,answer){
  const data = {
    username:uname,
    securityQuestionAnswer:answer,

  }
  return request({
    url:api.checkSecUser,
    method:'post',
    data
  })
}export function showUserSec(uname){
  const data = {
    username:uname,

  }
  return request({
    url:api.showUserSec,
    method:'post',
    data
  })
}

//答者
//答者找回密码时发送短信
export function findPwdSmsAnswerer(phone){
  const data = {
    phone:phone
  }
  return request({
    url:api.findPwdSmsAnswerer,
    method:'post',
    data
  })
}
//通过密保找回密码
export function checkSecAnswerer(usname,answer){
  const data = {
    username:usname,
    securityQuestionAnswer:answer,

  }
  return request({
    url:api.checkSecAnswerer,
    method:'post',
    data
  })
}
//找回密码（重置密码）
export function resetPwdAnswerer(uname,newpass){
  const data = {
    username:uname,
    newpassword:newpass,
  }
  return request({
    url:api.resetPwdAnswerer,
    method:'post',
    data
  })
}
export function showAnswererSec(uname){
  const data = {
    username:uname,

  }
  return request({
    url:api.showAnswererSec,
    method:'post',
    data
  })
}

//租户
//找回密码
export function findPwdSmsTenement(phone){
  const data = {
    phone:phone
  }
  return request({
    url:api.findPwdSmsTenement,
    method:'post',
    data
  })
}
export function resetPwdTenement(uname,pass){
  const data = {
    username:uname,
    newpassword:pass,
  }
  return request({
    url:api.resetPwdTenement,
    method:'post',
    data
  })
}
export function checkSecTenement(uname,answer){
  const data = {
    username:uname,
    securityQuestionAnswer:answer,
  }
  return request({
    url:api.loginSmsTenement,
    method:'post',
    data
  })
}
export function showTenementSec(uname){
  const data = {
    username:uname
  }
  return request({
    url:api.showTenementSec,
    method:'post',
    data
  })
}
